#include<iostream>
#include<string>
#include<cstring>
#include<math.h>
#include<stack>
using namespace std;

bool isOperateChar(char x[]){
	if((x[0]=='+'||x[0]=='-'||x[0]=='*'||x[0]=='/')&&strlen(x)==1)
	return true;
	else
	return false;
}
double calc(){
	char temp[1005];
	scanf("%s",temp);
	
	if(isOperateChar(temp)){
		switch (temp[0]){
			case '+':
				return calc()+calc();
			case '-':
				return calc()-calc();
			case '*':
				return calc()*calc();
			case '/':
				return calc()/calc();
		}
	}else{
		return atof(temp);
	}
}
typedef struct BNode{
	int v;
	struct BNode *lchild;
	struct BNode *rchild;
};
stack<BNode> s;
void preOrder(BNode *T){
	if(T!=NULL){
		cout<<T->v<<endl;
		preOrder(T->lchild);
		preOrder(T->rchild);
	}
}
void preOrder2(BNode *T){	
	BNode *p=T;
	while(p!=NULL||!s.emtpy()){
		if(p){
			s.push(p);
			p=p->lchild;
		}else{
			p=s.top();s.pop();
			visit(p);
			p=p->rchild;
		}
	}
}
/*
string id;
string name;
string gender;
string address;
float score;
int age;
typedef struct Stu{
	string id;
	string name;
	string gender;
	int age;
	float score;
	string address;
	
	struct Stu *next;
};
*/
typedef struct LNode{
	int v;
	struct LNode *next;
};
/*
int flag[305];
int n,m; 
*/

/*
int n,m;
LNode L[305];
*/
int main(){
	//判断单链表中是否有环，找到环的入口节点
	/*
	LNode L[100];
	for(int i=0;i<99;i++){
		L[i].v=i;
		L[i].next=&L[i+1];
	}
	L[99].v=99;
	L[99].next=&L[20];
	
	LNode* slow;
	LNode* fast;
	int sNum=0,fNum=0;
	slow=L[0].next;
	sNum=1;
	fast=L[0].next;
	fast=fast->next;
	fNum=2;
	while(slow!=fast){
		slow=slow->next;
		sNum+=1;
		fast=fast->next->next;
		fNum+=2;
	}
	cout<<"环的长度是："<<sNum<<endl;
	
	fast=&L[0];
	while(slow!=fast){
		slow=slow->next;
		fast=fast->next;
	}
	cout<<"环的入口数字是："<<(*slow).v<<endl;
	*/
	
	//1748:约瑟夫问题
	/*
	while(cin>>n>>m){
		if(n==0&&m==0){
			return 0;
		}
		
		for(int i=1;i<=n;i++){
			L[i].v=i;
			L[i].next=&L[i+1];
		}
		L[n].next=&L[1];
		
		LNode *pre=&L[n];
		LNode *p=&L[1];
		int mNum=0;
		int count=0;
		while(true){
			if(mNum==m-1){
				pre->next=p->next;
				p=p->next;
				count++;
				if(count==n-1)
				break;
			}else{
				pre=p;
				p=p->next;
			}
			
			mNum=(mNum+1)%m;
		}
		cout<<(*p).v<<endl;	
	}
	*/
	
	//1748:约瑟夫问题
	/*
	while(cin>>n>>m){
		if(n==0&&m==0)
		return 0;
		int index=-1;
		int count;
		for(int i=1;i<n;i++){
			count=0;
			
			while(count<m){
				index=(index+1)%n;
				
			}
		}
		for(int j=0;j<n;j++){
			if(flag[j]==0){
				cout<<j+1<<endl;
				break;
			}
		}
	}
	*/
	
	
	//6378:删除数组中的元素（链表）
	/*	
	int n;
	cin>>n;
	LNode *head=new LNode;
	LNode *tail;
	tail=head;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		LNode *p=new LNode;
		p->v=x;
		p->next=NULL;
		
		tail->next=p;
		tail=p;
	}
	
	int k;
	cin>>k;
	LNode *p,*pre;
	pre=head;p=head->next;
	while(p!=NULL){
		if(p->v==k){
			LNode *s=p;
			pre->next=p->next;
			p=p->next;
			delete s;
		}else{
			cout<<p->v<<' ';
			pre=p;
			p=p->next;
		}
	}
	*/
	
	//6379:统计学生信息（使用动态链表完成）
	/*
	Stu *head=new Stu;
	head->next=NULL;
	
	while(cin>>id){
		if(id=="end")
		break;
		
		cin>>name>>gender>>age>>score>>address;
		Stu *s=new Stu;
		s->id=id;
		s->name=name;
		s->gender=gender;
		s->age=age;
		s->score=score;
		s->address=address;
		s->next=NULL;
		
		s->next=head->next;
		head->next=s;
	}
	
	Stu *p=head->next;
	while(p!=NULL){
		cout<<p->id<<" "<<p->name<<" "<<p->gender<<" "<<p->age<<" "<<p->score<<" "<<p->address<<endl;
		p=p->next;
	}
	*/
	
	
	//1696:逆波兰表达式
	printf("%f",calc());
	
	return 0;
}
